<template>
    <el-container>
      <el-header>
        <el-header class="auto"><goback :content="content"></goback></el-header>
      </el-header>
      <el-main>
        <el-tabs type="border-card" v-model="tab" @tab-click="handleClick">
          <el-tab-pane>
<!--            <span slot="label" name="0" v-if="waitCount.xz" class="mytab"><el-badge :value="waitCount.xz" class="flag">立项数据</el-badge></span>-->
            <span slot="label" name="0">行政数据</span>
            <baoxiaoList></baoxiaoList>
          </el-tab-pane>
          <el-tab-pane>
            <span slot="label" name="1">考勤数据</span>
            <attendList></attendList>
          </el-tab-pane>
        </el-tabs>
      </el-main>
    </el-container>
</template>

<script>
    import goback from "../common/goback";
    import baoxiaoList from "./baoxiaoList";
    import attendList from "./attendList";
    import noticeList from "./noticeList";
    import {mapActions} from 'vuex'
    export default {
        name: "adminList",
        data(){
            return {
                content: '行政数据',
                tab: 0,

            }
        },
        components:{goback,baoxiaoList,attendList,noticeList},
        methods: {
            ...mapActions("AdminData",["getBaoXiaoActions","getLoginListActions"]),
            handleClick(tab,event){
                let index = tab.index
                switch(index){
                    case '1':
                      this.content = '考勤数据'
                      this.getLoginListActions({page: 1,page_size: 10})
                      break;
                    case '2':
                       this.content = '公告管理'
                       break;
                    default:
                        this.content = '行政数据'
                        this.getBaoXiaoActions({page: 1,page_size: 10,state: 0})
                }
            }
        },
        mounted() {
            this.getBaoXiaoActions({page: 1,page_size: 10,state: 0})
        }
    }
</script>

<style scoped>

</style>
